/**
 * 
 */
package algo3c2g15.domain;

import org.w3c.dom.Document;
import org.w3c.dom.Element;


/**
 * @author De La
 *
 */
public class Posicion {
	public Integer x;
	public Integer y;
	
	public Posicion(){
		super();
		x = new Integer(0);
		y = new Integer(0);
	}
	
	public Posicion(Integer x, Integer y){
		super();
		this.x = new Integer(x);
		this.y = new Integer(y);
	}
	
	public Posicion(Element xmlElement){
		this.x = (Integer.parseInt(xmlElement.getAttribute("x")));
		this.y = (Integer.parseInt(xmlElement.getAttribute("y")));
	}
	
	public Element getElementXml(Document doc) {

		Element elemPosicion = doc.createElement("POSICION");
			
		elemPosicion.setAttribute("x", x.toString());
		elemPosicion.setAttribute("y", y.toString());

		return elemPosicion;
		
	}
}
